//添加班级
const myClass = require("../models/class");
let newClass ={
    className:"java",
    classBooks:[
        {
            bookName:"java从入门到精通"
        },
        {
            bookName:"java核心思想"
        },
        {
            bookName:"web从入门到精通"
        },
        {
            bookName:"编程思想"
        },
    ]
}

let newClass1 ={
    className:"node",
    classBooks:[
        {
            bookName:"node从入门到精通"
        },
        {
            bookName:"nodeJS"
        },
    ]
}


let newClass2 ={
    className:"h5",
    classBooks:[
        {
            bookName:"h5从入门到精通"
        },
        {
            bookName:"h5"
        },
    ]
}

createClass(newClass2);
async function createClass(obj){
    try{
        let creataaa= new myClass(obj);
        let Nb = await myClass.create(creataaa);
        console.log(Nb);
    }catch(err){
        console.log(err.message);
    }
}